// @file          TechVisionScanStation.groovy
// @author        Mac Radigan
// @description 

package ycoa.scan.process

import ycoa.xml.*
import org.w3c.dom.Element

public class TechVisionScanStation extends ScanStation {

  public boolean process(reference, directory, outfile, logs) { 
    def initialSize = 4096
    def outStream = new ByteArrayOutputStream(initialSize)
    def errStream = new ByteArrayOutputStream(initialSize)
    def cmdSignin = "wscript d:\\YCOA_WEB\\bin\\formIdea.vbs "
    cmdSignin += " $reference $directory $outfile "
    println '  [execute]   '+cmdSignin
    def procSignin = cmdSignin.execute()
    procSignin.consumeProcessOutput(outStream, errStream)
    procSignin.waitFor()
    if(procSignin.exitValue()) {
      println errStream
    } else {
      println outStream
    }
    //new File('out.log') << outStream
    //new File('out.err') << errStream
    return true
  } 

}

/* *EOF* */
